<script type="text/javascript">{$javaScript}</script>
<style type="text/css">{$styleSheet}</style>

<!-- menu include -->
{include file="menu.tpl"}
<div>
<div id="search">
	<br/>
	<form name="game-search" method="GET" action="{$HOST}/games.php">
	<table>
	  <tr>
	    <td>
		&nbsp;&nbsp;Search for game: 
		<input type="hidden" name="do" value="search" />
		<input type = "text" name="keyword" />
		<input type="submit" value="Search" />
		<br/><br/>
		&nbsp;&nbsp;<span style="font-family: sans-serif; color: #2c8bf9;">{$numberOfGames}</span> games listed on WiiSocial.<br/><br/>
		</td>
		<td valign="top">
		<input type="radio" name="locale" id="us" value="us" />
		<label for="us"><img src="{$HOST}/html/images/us.png"/><span style="font-family: sans-serif; size: 10px;"> Amazon.com</span></label><br/>
		<input type="radio" name="locale" id="gb" value="gb" />
		<label for="uk"><img src="{$HOST}/html/images/gb.png"/><span style="font-family: sans-serif; size: 10px;"> Amazon.co.uk</span></label><br/>
		<input type="radio" name="locale" id="wii-ware" value="wii-ware" />
		<label for="wii-ware">WiiWare</label>
		</td>
	  </tr>
	</table>
	</form>
	<br/>
</div>

<div id="index-search">
	{foreach from=$alphabet item=letter}
		<a href="{$HOST}/games.php?do=alphabetical&amp;index={$letter}">
		{if $letter == $activeIndex}
			<span class="active">{$letter}</a>
		{else}
			{$letter}
		{/if}
		</a>|
	{/foreach}
</div>
{if $numberOfMatchingResults}
<div id="results-found">Results found: <b>{$numberOfMatchingResults}</b></div>
{/if}

{foreach from=$indexedGames item=game}
<div id="game">
<h1><a href="http://wii-social.com/external.php?url={$game->getAmazonAssociateURL()}&amp;game-id={$game->getID()}" target="_blank">{$game->getTitle()}</a> <img src="{$game->getLocaleFlagSrc($game->getLocale())}" title="{$game->getLocaleFlagTitle($game->getLocale())}" /></h1>
<table>
  <tr>
    <td class="image"><a href="http://wii-social.com/external.php?url={$game->getAmazonAssociateURL()}&game-id={$game->getID()}" target="_blank"><img src="{if $game->getImageUrl()}{$game->getImageUrl()}{else}http://wii-social.com/html/images/no-image.png{/if}" width="50" height="75" /></a></td>
    <td width="50" style="padding-left: 10px; font-family: verdana; color: #b7b7b7; font-size: 12px">
      By <br/>
      Released: <br/><br/>
      <br/>
    </td>
    <td width="250" style="padding-left: 10px; font-family: verdana; color: #000000; font-size: 12px">
      {$game->getManufacturer()}<br/>
      {$game->getReleaseDate()}<br/><br/>
      <span style="font-family: sans-serif; color: #2c8bf9;"><b>{$game->getNumberOfPlayers()}</b></span> Players, and on <span style="font-family: sans-serif; color: #2c8bf9;"><b>{$game->getNumberOfWishLists()}</b></span> Wishlists
    </td>
    <td valign="top">
      <ul>
      <li><img src="http://wii-social.com/html/images/add.png"/>&nbsp;<a href="{$HOST}/GameHandler.php?do=collection-add&amp;id={$game->getID()}">Add to Owned</a></li>
      <li><img src="http://wii-social.com/html/images/mouse_add.png"/>&nbsp;<a href="{$HOST}/GameHandler.php?do=wishlist-add&amp;id={$game->getID()}">Add to WishList</a></li>
      <li><img src="http://wii-social.com/html/images/information.png"/>&nbsp;<span onclick=showGameDescription('{$game->getID()}')>More Info</span></li>
      <li><img src="http://wii-social.com/html/images/cart_add.png"/>&nbsp;<a href="http://wii-social.com/external.php?url={$game->getAmazonAssociateURL()}">Buy</a></li>
	  </ul>
    </td>
  </tr>
</table>
</div>
<div id="game-description-{$game->getID()}" class="game-description">
<div id="toolbar"><span style="float: left;">More Info</span><span style="float: right;" onclick=hideGameDescription('{$game->getID()}')><img src="http://wiisocial.mattmakins.co.uk/html/images/cancel.png"/></span></div>
<h1>Game Description</h1>
{if $game->getDescription()}
  <p>{$game->getDescription()}</p>
{else}
  <p>Sorry, no game description available</p>
{/if}
</div>
{if $adminUser}
<a href="{$HOST}/games.php?do=delist-game&amp;game-id={$game->getID()}">delist</a>
{/if}
</div>
{/foreach}
<fb:google-analytics uacct="UA-1595732-3" />
<!-- /div-->